package com.yunji.cabinet.consumer;

import cn.hutool.core.lang.Pair;
import com.yunji.base.dto.AgentDTO;
import com.yunji.base.provide.BaseDataAgentProvide;
import com.yunji.base.provide.BaseDataBelongProvide;
import com.yunji.base.provide.BaseDataSiteProvide;
import com.yunji.base.provide.BaseDataStaffProvide;
import com.yunji.common.model.domain.StaffDO;
import com.yunji.common.model.cache.ProductBelongCacheDTO;
import com.yunji.product.provide.ProductProvide;
import com.yunji.storage.domain.StockDO;
import com.yunji.storage.provide.StockProvide;
import com.yunji.system.provide.SystemProvide;
import org.springframework.stereotype.Component;

import javax.annotation.Resource;
import java.util.List;

/**
 * @Project: yunji-coffee
 * @Package: com.yunji.cabinet.consumer
 * @Title: CabinetConsumer
 * <p>
 * History:
 * Date                     Version     Author          Summary
 * ============================================================
 * 2024-10-25 14:29:46      V1.0        HuaAo       新建类
 */
@Component
public class CabinetConsumer {

    @Resource
    BaseDataBelongProvide belongProvide;

    @Resource
    BaseDataSiteProvide siteProvide;

    @Resource
    BaseDataStaffProvide staffProvide;

    @Resource
    BaseDataAgentProvide agentProvide;

    @Resource
    StockProvide stockProvide;

    @Resource
    ProductProvide productProvide;

    @Resource
    SystemProvide systemProvide;

    public Integer getStockStatus(Long belongId) {
        return belongProvide.selectStockStatus(belongId);
    }

    public void handleStock(List<StockDO> list) {
        stockProvide.handleStock(list);
    }

    public AgentDTO selectAgent(Long agentId) {
        return agentProvide.selectAgent(agentId);
    }

    public void deleteUserToken(Long belongId) {
        systemProvide.deleteUserToken(belongId);
    }

    public void deleteStaffTokeByBelongId(Long belongId) {
        staffProvide.deleteStaffTokenByBelongId(belongId);
    }

    public List<StaffDO> listByManagerId(Long managerId) {
        return staffProvide.listByManagerId(managerId);
    }

    public ProductBelongCacheDTO getProductById(Long productId, Long belongId) {
        return productProvide.covertCellPrice(productId, belongId);
    }

    public Pair<String, String> getProductNameAndPics(Long productId) {
        return productProvide.getProductNameAndPics(productId);
    }
}